<?php
include("../conn.php");

// 分页
if($_REQUEST['page']!="" && $_REQUEST['pagesize']!=""){
	$de=$_REQUEST['page']*$_REQUEST['pagesize'];
	$size=$_REQUEST['pagesize'];
}else{
	$de=0;
	$size=10;
}
// 分页 end
$query = mysql_query("select * from homefenlei order by sort desc  limit $de,$size");

$homefenlei = array();
$i=0;
while ($row = mysql_fetch_assoc($query)) {
	$homefenlei[$i][id] = $row[id];
	$homefenlei[$i][homefenleiId] = $row[id];
	$homefenlei[$i][name] = $row[name];
	$homefenlei[$i][images] = $row[srcimages];
	$homefenlei[$i][cateids] = $row[cateids];
	$homefenlei[$i][type] = $row[type];
	$i++;
}
$arr = array('code' => 200, 'msg' =>'查询首页分类成功', 'homefenlei' => $homefenlei);
echo json_encode($arr);